package com.mes.service.jy;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mes.dao.jy.PlanjyMapper;
import com.mes.entity.hy.Equipment;
import com.mes.entity.hy.Product;
import com.mes.entity.jy.CustomerOrderAndDetailjy;
import com.mes.entity.jy.CustomerOrderjy;
import com.mes.entity.jy.Plandetail;
import com.mes.entity.jy.Planjy;
import com.mes.entity.jy.Queryjy;

/**
 * @ClassName: ProductPlanServiseImpl 
 * @Description:生产计划单业务层实现类
 * @Author jy
 * @Date 2017年12月25日 上午10:57:00 
 * @version 1.0
 */
@Service
@Transactional
public class ProductPlanServiseImpl implements ProductPlanServise{

	@Resource
	private PlanjyMapper planjyMapper;
	
	@Override
	public int countCustomerOrder(Queryjy queryjy) {
		return planjyMapper.countCustomerOrder(queryjy);
	}

	@Override
	public List<CustomerOrderjy> customerOrderPagine(Queryjy queryjy) {
		return planjyMapper.customerOrderPagine(queryjy);
	}

	@Override
	public int countCostomerOrderDetail(long sid) {
		return planjyMapper.countCostomerOrderDetail(sid);
	}

	@Override
	public List<CustomerOrderAndDetailjy> seselectSalePlanDetailBysid(long sid) {
		return planjyMapper.seselectSalePlanDetailBysid(sid);
	}

	@Override
	public Product selsectProductByid(Long productid) {
		return planjyMapper.selsectProductByid(productid);
	}

	@Override
	public int createPlan(Planjy planjy) {
		return planjyMapper.createPlan(planjy);
	}

	@Override
	public int countProductPlan(Queryjy queryjy) {
		return planjyMapper.countProductPlan(queryjy);
	}

	@Override
	public List<Planjy> selectProductPlanPagein(Queryjy queryjy) {
		return planjyMapper.selectProductPlanPagein(queryjy);
	}

	@Override
	public List<Planjy> selectProductPlanByState(Queryjy queryjy2) {
		return planjyMapper.selectProductPlanByState(queryjy2);
	}

	@Override
	public List<Equipment> selectEqupment(Queryjy queryjy3) {
		return planjyMapper.selectEqupment(queryjy3);
	}

	@Override
	public Planjy selectProductPlanByid(long id) {
		return planjyMapper.selectProductPlanByid(id); 
	}

	@Override
	public int selectsaleDetaiplannuml(String sdetailid) {
		
		Long sid = Long.valueOf(sdetailid);
		if(sid != null) {
			return planjyMapper.selectsaleDetaiplannuml(sid);
		}else {
			return planjyMapper.selectsaleDetaiplannuml(0L);
		}
	}

	@Override
	public int deletePlan(String pids) {
		
		return planjyMapper.deletePlan(pids);
	}

	@Override
	public void editPlanState(Planjy planjy) {
		planjyMapper.editPlanState(planjy);
	}

	@Override
	public void editSstate1(String plannum) {
		planjyMapper.editSstate1(plannum);
	}

	@Override
	public String countProductNum(Long productorid) {
		return planjyMapper.countProductNum(productorid);
	}

	@Override
	public List<String> selectWorkBypid(Long id) {
		return planjyMapper.selectWorkBypid(id);
	}

	@Override
	public List<String> selectWorkBypid2(Long id) {
		return planjyMapper.selectWorkBypid2(id);
	}

	@Override
	public void editSstate2(Plandetail plandetail3) {
		planjyMapper.editSstate2(plandetail3);
	}

	@Override
	public List<Long> selectUserByJob(Queryjy queryjy) {
		return planjyMapper.selectUserByJob(queryjy);
	}

	@Override
	public List<Equipment> selectEqupment2(Long cid) {
		return planjyMapper.selectEqupment2(cid);
	}

	@Override
	public void editSstate3(CustomerOrderjy customerOrderjy) {
		planjyMapper.editSstate3(customerOrderjy);
	}

	@Override
	public String selectWorkBydid(Long did) {
		return planjyMapper.selectWorkBydid(did);
	}

	@Override
	public String selectWorkBydid2(Long did) {
		return planjyMapper.selectWorkBydid2(did);
	}

}
